package com.cloudy.s3.request;

import com.cloudy.exception.AWSAccessException;
import com.cloudy.impl.SuccessHandlerWithResponse;
import com.cloudy.s3.response.ListBucketResult;

public class ListBucket extends S3Request{

	public ListBucket(String bucketName) {
		super(bucketName, "GET");
		super.successHandler = new SuccessHandlerWithResponse();
	}
	public ListBucket prefix(String prefix) {
		attributes.put("prefix", prefix);
		return this;
	}
	public ListBucket marker(String marker) {
		attributes.put("marker", marker);
		return this;
	}
	public ListBucket maxKeys(int maxKeys) {
		attributes.put("max-keys", String.valueOf(maxKeys));
		return this;
	}public ListBucket delimeter(String delimeter) {
		attributes.put("delimeter", delimeter);
		return this;
	}

	public ListBucketResult execute() throws AWSAccessException {
		return (ListBucketResult) executeInner().getResponse();
	}

}
